<div class="bm">
	<p class="tbmu">
		<a href="forum.php?mod=group&action=manage&op=group&fid=$_G[fid]"{if $_G['gp_op'] == 'group'} class="a"{/if}>{lang group_setup}</a>
	<!--{if !empty($groupmanagers[$_G[uid]])}-->
		 | <a href="forum.php?mod=group&action=manage&op=checkuser&fid=$_G[fid]"{if $_G['gp_op'] == 'checkuser'} class="a"{/if}>{lang group_member_moderate}</a>
		 | <a href="forum.php?mod=group&action=manage&op=manageuser&fid=$_G[fid]"{if $_G['gp_op'] == 'manageuser'} class="a"{/if}>{lang group_member_management}</a>
	<!--{/if}-->
	<!--{if $_G['forum']['founderuid'] == $_G['uid']}-->
		 | <a href="forum.php?mod=group&action=manage&op=threadtype&fid=$_G[fid]"{if $_G['gp_op'] == 'threadtype'} class="a"{/if}>{lang group_threadtype}</a>
		 | <a href="forum.php?mod=group&action=manage&op=demise&fid=$_G[fid]"{if $_G['gp_op'] == 'demise'} class="a"{/if}>{lang group_demise}</a>
	<!--{/if}-->
	</p>
</div>
	<!--{if $_G['gp_op'] == 'group'}-->
	<div class="bm">
		<form enctype="multipart/form-data" action="forum.php?mod=group&action=manage&op=group&fid=$_G[fid]" name="manage" method="post" autocomplete="off">
			<input type="hidden" value="{FORMHASH}" name="formhash" />
			<table cellspacing="0" cellpadding="0" class="tfm" summary="{lang group_admin_panel}">
				<tbody>
					<tr>
						<th></th>
						<td><strong class="rq"><em id="returnmessage4"></em></strong></td>
					</tr>
					<!--{if !empty($specialswitch['allowchangename']) && $_G['uid'] == $_G['forum']['founderuid']}-->
					<tr>
						<th><strong class="rq y">*</strong>{lang group_name}:</th>
						<td><input type="text" id="name" name="name" class="px" size="36" tabindex="1" value="$_G[forum][name]" autocomplete="off" onBlur="checkgroupname()" tabindex="1" /></td>
					</tr>
					<!--{/if}-->
					<!--{if in_array($_G['adminid'], array(1,2))}-->
					<tr>
						<th>{lang group_push_to_forum}</th>
						<td>
							<select id="recommend" name="recommend">
								<option value="0">{lang group_do_not_push}</option>
								$forumselect
							</select>
						</td>
					</tr>
					<!--{/if}-->
					<!--{if !empty($specialswitch['allowchangetype']) && $_G['uid'] == $_G['forum']['founderuid']}-->
					<tr>
						<th><strong class="rq y">*</strong>{lang group_category}:</th>
						<td>
							<select tabindex="2" class="ps" onchange="ajaxget('forum.php?mod=ajax&action=secondgroup&fupid='+ this.value, 'secondgroup');">
								$groupselect[first]
							</select>
							<em id="secondgroup"><select id="fup" name="fup" class="ps" >$groupselect[second]</select></em>
						</td>
					</tr>
					<!--{/if}-->
					<tr>
						<th>{lang group_description}</th>
						<td><textarea name="descriptionnew" class="pt" rows="3" cols="40">$_G[forum][descriptionnew]</textarea></td>
					</tr>
					<tr>
						<th>{lang group_perm_visit}</th>
						<td><label><input type="radio" name="gviewpermnew" class="pr" value="1" $gviewpermselect[1]> {lang group_perm_all_user}</label> <label><input type="radio" name="gviewpermnew" class="pr" value="0" $gviewpermselect[0]> {lang group_perm_member_only}</label></td>
					</tr>
					<tr>
						<th>{lang group_join_type}</th>
						<td>
							<label><input type="radio" name="jointypenew" class="pr" value="0" $jointypeselect[0] /> {lang group_join_type_free} </label>
							<label><input type="radio" name="jointypenew" class="pr" value="2" $jointypeselect[2] /> {lang group_join_type_moderate} </label>
							<label><input type="radio" name="jointypenew" class="pr" value="1" $jointypeselect[1] /> {lang group_join_type_invite} </label>
							<!--{if !empty($specialswitch['allowclosegroup']) && $_G['uid'] == $_G['forum']['founderuid']}-->
							<input type="radio" name="jointypenew" class="pr" value="-1" $jointypeselect[-1] /> {lang close} 
							<p class="d">{lang group_close_notice}</p>
							<!--{/if}-->
						</td>
					</tr>
					<!--{if !empty($_G['group']['allowupbanner']) || $_G['adminid'] == 1}-->
					<tr>
						<th>{lang group_image}</th>
							<td>
								<input type="file" name="bannernew" id="bannernew" class="pf" size="25" />
						<!--{if $_G['forum']['banner']}-->
								<input type="checkbox" name="deletebanner" class="pc" value="1" /> {lang group_no_image}
								<p class="d">{lang group_no_image_comment}</p>
							</td>
						<tr>
							<th></th>
							<td><img width="544" src="$_G[forum][banner]?{TIMESTAMP}" />
						<!--{/if}-->
							<p class="d">
								{lang group_image_resize} &nbsp;
								<!--{if $_G[setting][group_imgsizelimit]}-->
									{lang group_image_filesize_limit}
								<!--{/if}-->
							</p>
							</td>
					</tr>
					<!--{/if}-->
					<tr>
						<th>{lang group_icon}</th>
						<td>
							<input type="file" id="iconnew" class="pf" size="25" style="vertical-align: middle;" name="iconnew" />
							<p class="d">{lang group_icon_resize}</p>
							<!--{if $_G['forum']['icon']}-->
								<img width="48" height="48" style="vertical-align: middle; margin-right: 1em;" src="$_G[forum][icon]?{TIMESTAMP}" />
							<!--{/if}-->
						</td>
					</tr>
					<tr>
						<th></th>
						<td><button type="submit" name="groupmanage" class="pn pnp" value="1"><strong>{lang submit}</strong></button></td>
					</tr>
				</tbody>
			</table>
		</form>
	</div>

<script type="text/javascript">
	function checkgroupname() {
		var oldgroupname = '$_G[forum][name]';
		var groupname = trim($('name').value);
		if(groupname != oldgroupname) {
			ajaxget('forum.php?mod=ajax&forumcheck=1&infloat=creategroup&handlekey=creategroup&action=checkgroupname&groupname=' + (BROWSER.ie && document.charset == 'utf-8' ? encodeURIComponent(groupname) : groupname), 'returnmessage4');
		}
	}
</script>
	<!--{elseif $_G['gp_op'] == 'checkuser'}-->
	<div class="bm">
		<!--{if $checkusers}-->
			<p class="pbn bbda cl"><em class="y"><a href="forum.php?mod=group&action=manage&op=checkuser&fid=$_G[fid]&checkall=2">{lang ignore_all}</a> | <a href="forum.php?mod=group&action=manage&op=checkuser&fid=$_G[fid]&checkall=1">{lang pass_all}</a></em></p>
			<div class="xld xlda">
			<!--{loop $checkusers $uid $user}-->
				<dl class="bbda cl">
					<dd class="m avt">{echo discuz_uc_avatar($user[uid], 'small')}</dd>
					<dt><a href="home.php?mod=space&amp;uid=$user[uid]">$user[username]</a> <span class="xw0">($user['joindateline'])</span></dt>
					<dd class="pns"><button type="submit" name="checkusertrue" class="pn pnp" value="true" onclick="location.href='forum.php?mod=group&action=manage&op=checkuser&fid=$_G[fid]&uid=$user[uid]&checktype=1'"><em>{lang pass}</em></button> &nbsp; <button type="submit" name="checkuserfalse" class="pn" value="true" onclick="location.href='forum.php?mod=group&action=manage&op=checkuser&fid=$_G[fid]&uid=$user[uid]&checktype=2'"><em>{lang ignore}</em></button></dd>
				</dl>
			<!--{/loop}-->
			</div>
			<!--{if $multipage}--><div class="pgs cl">$multipage</div><!--{/if}-->
		<!--{else}-->
			<p>{lang group_no_member_moderated}</p>
		<!--{/if}-->
	</div>
	<!--{elseif $_G['gp_op'] == 'manageuser'}-->

			<form action="forum.php?mod=group&action=manage&op=manageuser&fid=$_G[fid]" name="manageuser" method="post" autocomplete="off">
				<input type="hidden" value="{FORMHASH}" name="formhash" />
				<!--{if $adminuserlist}-->
					<div class="bm">
						<h2>{lang group_admin_member}</h2>
						<ul class="ml mls cl">
							<!--{loop $adminuserlist $user}-->
							<li>
								<a href="home.php?mod=space&amp;uid=$user[uid]" title="{if $user['level'] == 1}{lang group_moderator}{elseif $user['level'] == 2}{lang group_moderator_vice}{/if}{if $user['online']} {lang login_normal_mode}{/if}" class="avt">
									<!--{if $user['level'] == 1}-->
										<em class="gm"></em>
									<!--{elseif $user['level'] == 2}-->
										<em class="gm" style="filter: alpha(opacity=50); opacity: 0.5"></em>
									<!--{/if}-->
									<!--{if $user['online']}-->
										<em class="gol"></em>
									<!--{/if}-->
									{echo discuz_uc_avatar($user[uid], 'small')}
								</a>
								<p><a href="home.php?mod=space&amp;uid=$user[uid]">$user[username]</a></p>
								<p><!--{if $_G['uid'] != $user['uid'] && ($_G['uid'] == $_G['forum']['founderuid'] || $user['level'] > $groupuser['level'])}--><input type="checkbox" class="pc" name="muid[{$user[uid]}]" value="$user[level]" /><!--{/if}--></p>
							</li>
							<!--{/loop}-->
						</ul>
					</div>
					<hr class="da" />
				<!--{/if}-->
				<!--{if $staruserlist || $userlist}-->
					<div class="bm">
						<h2>{lang member}</h2>
						<!--{if $staruserlist}-->
							<ul class="ml mls cl">
								<!--{loop $staruserlist $user}-->
								<li>
									<a href="home.php?mod=space&amp;uid=$user[uid]" title="{lang group_star_member}{if $user['online']} {lang login_normal_mode}{/if}" class="avt">
										<em class="gs"></em>
										<!--{if $user['online']}-->
											<em class="gol"{if $user['level'] <= 3} style="margin-top: 15px;"{/if}></em>
										<!--{/if}-->
										{echo discuz_uc_avatar($user[uid], 'small')}
									</a>
									<p><a href="home.php?mod=space&amp;uid=$user[uid]">$user[username]</a></p>
									<p><!--{if $user['level'] > $groupuser['level']}--><input type="checkbox" class="pc" name="muid[{$user[uid]}]" value="$user[level]" /><!--{/if}--></p>
								</li>
								<!--{/loop}-->
							</ul>
						<!--{/if}-->
						<!--{if $userlist}-->
							<ul class="ml mls cl">
								<!--{loop $userlist $user}-->
								<li>
									<a href="home.php?mod=space&amp;uid=$user[uid]" class="avt">{echo discuz_uc_avatar($user[uid], 'small')}</a>
									<p><a href="home.php?mod=space&amp;uid=$user[uid]">$user[username]</a></p>
									<p><!--{if $user['level'] > $groupuser['level']}--><input type="checkbox" class="pc" name="muid[{$user[uid]}]" value="$user[level]" /><!--{/if}--></p>
								</li>
								<!--{/loop}-->
							</ul>
						<!--{/if}-->
					</div>
				<!--{/if}-->
				<hr class="da" />
				<div class="bm">
					<select name="targetlevel" class="ps">
						<!--{loop $mtype $key $name}-->
							<!--{if $_G['forum']['founderuid'] == $_G['uid'] || $key > $groupuser['level'] || $_G['adminid'] == 1}-->
								<option value="$key" {if $key == $user['level']} selected{/if}>$name</option>
							<!--{/if}-->
						<!--{/loop}-->
					</select>
					<input type="submit" class="ps" name="manageuser" value="{lang submit}">
				</div>
			</form>
			$multipage
	<!--{elseif $_G['gp_op'] == 'threadtype'}-->
		<div class="bm">
			<!--{if empty($specialswitch['allowthreadtype'])}-->
				{lang group_level_cannot_do}
			<!--{else}-->
			<script type="text/JavaScript">
				var rowtypedata = [
					[
						[1,'<input type="checkbox" class="checkbox" disabled="disabled" />', 'td25'],
						[1,'<input type="checkbox" class="checkbox" name="newenable[]" checked="checked" />', 'td25'],
						[1,'<input class="px" type="text" size="2" name="newdisplayorder[]" value="0" />'],
						[1,'<input class="px" type="text" name="newname[]" />']
					],
				];
				var addrowdirect = 0;
				var typenumlimit = $typenumlimit;
				function addrow(obj, type) {
					var table = obj.parentNode.parentNode.parentNode.parentNode;
					if(typenumlimit <= obj.parentNode.parentNode.parentNode.rowIndex - 1) {
						alert('{lang group_threadtype_limit_1}'+typenumlimit+'{lang group_threadtype_limit_2}');
						return false;
					}
					if(!addrowdirect) {
						var row = table.insertRow(obj.parentNode.parentNode.parentNode.rowIndex);
					} else {
						var row = table.insertRow(obj.parentNode.parentNode.parentNode.rowIndex + 1);
					}
					
					var typedata = rowtypedata[type];
					for(var i = 0; i <= typedata.length - 1; i++) {
						var cell = row.insertCell(i);
						cell.colSpan = typedata[i][0];
						var tmp = typedata[i][1];
						if(typedata[i][2]) {
							cell.className = typedata[i][2];
						}
						tmp = tmp.replace(/\{(\d+)\}/g, function($1, $2) {return addrow.arguments[parseInt($2) + 1];});
						cell.innerHTML = tmp;
					}
					addrowdirect = 0;
				}
			</script>
			<div id="threadtypes">
			<form id="threadtypeform" action="forum.php?mod=group&action=manage&op=threadtype&fid=$_G[fid]" autocomplete="off" method="post" name="threadtypeform">
			<input type="hidden" value="{FORMHASH}" name="formhash" />
				<table cellspacing="0" cellpadding="0" class="tfm">
				<tr>
					<th>{lang threadtype_turn_on}:</th>
					<td>
						<input type="radio" name="threadtypesnew[status]" class="pr" value="1" onclick="$('threadtypes_config').style.display = '';$('threadtypes_manage').style.display = '';" $checkeds[status][1]>&nbsp;{lang yes}
						<input type="radio" name="threadtypesnew[status]" class="pr" value="0" onclick="$('threadtypes_config').style.display = 'none';$('threadtypes_manage').style.display = 'none';"  $checkeds[status][0]>&nbsp;{lang no}
						<p class="d">{lang threadtype_turn_on_comment}</p>
					</td>
				</tr>
				<tbody id="threadtypes_config" style="display: $display">
				<tr>
					<th>{lang threadtype_required}:</th>
					<td>
						<input type="radio" name="threadtypesnew[required]" class="pr" value="1" $checkeds[required][1]>&nbsp;{lang yes}
						<input type="radio" name="threadtypesnew[required]" class="pr" value="0" $checkeds[required][0]>&nbsp;{lang no}
						<p class="d">{lang threadtype_required_force}</p>
					</td>
				</tr>
				<tr>
					<th>{lang threadtype_prefix}:</th>
					<td>
						<input type="radio" name="threadtypesnew[prefix]" class="pr" value="0" $checkeds[prefix][0]>&nbsp;{lang threadtype_prefix_off}
						<input type="radio" name="threadtypesnew[prefix]" class="pr" value="1" $checkeds[prefix][1]>&nbsp;{lang threadtype_prefix_on}
						<p class="d">{lang threadtype_prefix_comment}</p>
					</td>
				</tr>
				</tbody>
				</table>
				<div id="threadtypes_manage" style="display: $display">
				<h2 class="ptm">{lang threadtype}</h2>
					<table cellspacing="0" cellpadding="0" class="dt">
						<tr>
							<th>{lang delete}</th>
							<th>{lang enable}</th>
							<th>{lang displayorder}</th>
							<th>{lang threadtype_name}</th>
						</tr>
						<!--{if $threadtypes}-->
						<!--{loop $threadtypes $val}-->
						<tr>
							<td><input type="checkbox" name="threadtypesnew[options][delete][]" value="{$val[typeid]}" /></td>
							<td><input type="checkbox" name="threadtypesnew[options][enable][{$val[typeid]}]" value="1" class="checkbox" $val[enablechecked] /></td>
							<td><input type="text" name="threadtypesnew[options][displayorder][{$val[typeid]}]" class="px" size="2" value="$val[displayorder]" /></td>
							<td><input type="text" name="threadtypesnew[options][name][{$val[typeid]}]" class="px" value="$val[name]" /></td>
						</tr>
						<!--{/loop}-->
						<!--{/if}-->
						<tr>
							<td colspan="4">
								<div><img class="vm" src="{IMGDIR}/addicn.gif" /> &nbsp; <a href="###" onclick="addrow(this, 0)">{lang threadtype_add}</a></div>
							</td>
						</tr>
					</table>
				</div>
				<br><br>
				<button type="submit" class="pn pnp" name="groupthreadtype" value="1"><strong>{lang submit}</strong></button>
			</form>
			</div>
			<!--{/if}-->
		</div>
	<!--{elseif $_G['gp_op'] == 'demise'}-->
		<div class="bm">
		<!--{if $groupmanagers}-->
			{lang group_demise_comment}
			<form action="forum.php?mod=group&action=manage&op=demise&fid=$_G[fid]" name="groupdemise" method="post" class="exfm">
				<input type="hidden" value="{FORMHASH}" name="formhash" />
				<h2>{lang group_admin_member}</h2>
				<ul class="ml mls cl">
					<!--{loop $groupmanagers $user}-->
					<li>
						<a href="home.php?mod=space&amp;uid=$user[uid]" title="{if $user['level'] == 1}{lang group_moderator}{elseif $user['level'] == 2}{lang group_moderator_vice}{/if}{if $user['online']} {lang login_normal_mode}{/if}" class="avt">
							<!--{if $user['level'] == 1}-->
								<em class="gm"></em>
							<!--{elseif $user['level'] == 2}-->
								<em class="gm" style="filter: alpha(opacity=50); opacity: 0.5"></em>
							<!--{/if}-->
							{echo discuz_uc_avatar($user[uid], 'small')}
						</a>
						<p><a href="home.php?mod=space&amp;uid=$user[uid]">$user[username]</a></p>
						<p><input type="radio" class="pr" name="suid" value="$user[uid]" /></p>
					</li>
					<!--{/loop}-->
				</ul>
				<hr class="da" /><br>
				<h3>{lang group_input_password}</h3><input type="password" class="px" name="grouppwd"><br /><br />
				<button type="submit" class="pn pnp" name="groupdemise" value="1"><strong>{lang submit}</strong></button><br /><br />
				{lang group_demise_notice}
			</form>
		<!--{else}-->
			<p>{lang group_no_admin_member}</p>
		<!--{/if}-->
		</div>
	<!--{/if}-->
